/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.Meas.impl;

import EA_Model.IEC61970.Core.impl.EquipmentImpl;

import EA_Model.IEC61970.Meas.MeasPackage;
import EA_Model.IEC61970.Meas.PotentialTransformer;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Potential Transformer</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.Meas.impl.PotentialTransformerImpl#getAccuracyClass <em>Accuracy Class</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Meas.impl.PotentialTransformerImpl#getNominalRatio <em>Nominal Ratio</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Meas.impl.PotentialTransformerImpl#getPtClass <em>Pt Class</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class PotentialTransformerImpl extends EquipmentImpl implements PotentialTransformer {
	/**
	 * The cached value of the '{@link #getAccuracyClass() <em>Accuracy Class</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAccuracyClass()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.String accuracyClass;

	/**
	 * The cached value of the '{@link #getNominalRatio() <em>Nominal Ratio</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNominalRatio()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Float nominalRatio;

	/**
	 * The cached value of the '{@link #getPtClass() <em>Pt Class</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPtClass()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.String ptClass;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected PotentialTransformerImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return MeasPackage.Literals.POTENTIAL_TRANSFORMER;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String getAccuracyClass() {
		if (accuracyClass != null && accuracyClass.eIsProxy()) {
			InternalEObject oldAccuracyClass = (InternalEObject)accuracyClass;
			accuracyClass = (EA_Model.IEC61970.Domain.String)eResolveProxy(oldAccuracyClass);
			if (accuracyClass != oldAccuracyClass) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, MeasPackage.POTENTIAL_TRANSFORMER__ACCURACY_CLASS, oldAccuracyClass, accuracyClass));
			}
		}
		return accuracyClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String basicGetAccuracyClass() {
		return accuracyClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setAccuracyClass(EA_Model.IEC61970.Domain.String newAccuracyClass) {
		EA_Model.IEC61970.Domain.String oldAccuracyClass = accuracyClass;
		accuracyClass = newAccuracyClass;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MeasPackage.POTENTIAL_TRANSFORMER__ACCURACY_CLASS, oldAccuracyClass, accuracyClass));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float getNominalRatio() {
		if (nominalRatio != null && nominalRatio.eIsProxy()) {
			InternalEObject oldNominalRatio = (InternalEObject)nominalRatio;
			nominalRatio = (EA_Model.IEC61970.Domain.Float)eResolveProxy(oldNominalRatio);
			if (nominalRatio != oldNominalRatio) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, MeasPackage.POTENTIAL_TRANSFORMER__NOMINAL_RATIO, oldNominalRatio, nominalRatio));
			}
		}
		return nominalRatio;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float basicGetNominalRatio() {
		return nominalRatio;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setNominalRatio(EA_Model.IEC61970.Domain.Float newNominalRatio) {
		EA_Model.IEC61970.Domain.Float oldNominalRatio = nominalRatio;
		nominalRatio = newNominalRatio;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MeasPackage.POTENTIAL_TRANSFORMER__NOMINAL_RATIO, oldNominalRatio, nominalRatio));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String getPtClass() {
		if (ptClass != null && ptClass.eIsProxy()) {
			InternalEObject oldPtClass = (InternalEObject)ptClass;
			ptClass = (EA_Model.IEC61970.Domain.String)eResolveProxy(oldPtClass);
			if (ptClass != oldPtClass) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, MeasPackage.POTENTIAL_TRANSFORMER__PT_CLASS, oldPtClass, ptClass));
			}
		}
		return ptClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.String basicGetPtClass() {
		return ptClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setPtClass(EA_Model.IEC61970.Domain.String newPtClass) {
		EA_Model.IEC61970.Domain.String oldPtClass = ptClass;
		ptClass = newPtClass;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, MeasPackage.POTENTIAL_TRANSFORMER__PT_CLASS, oldPtClass, ptClass));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case MeasPackage.POTENTIAL_TRANSFORMER__ACCURACY_CLASS:
				if (resolve) return getAccuracyClass();
				return basicGetAccuracyClass();
			case MeasPackage.POTENTIAL_TRANSFORMER__NOMINAL_RATIO:
				if (resolve) return getNominalRatio();
				return basicGetNominalRatio();
			case MeasPackage.POTENTIAL_TRANSFORMER__PT_CLASS:
				if (resolve) return getPtClass();
				return basicGetPtClass();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case MeasPackage.POTENTIAL_TRANSFORMER__ACCURACY_CLASS:
				setAccuracyClass((EA_Model.IEC61970.Domain.String)newValue);
				return;
			case MeasPackage.POTENTIAL_TRANSFORMER__NOMINAL_RATIO:
				setNominalRatio((EA_Model.IEC61970.Domain.Float)newValue);
				return;
			case MeasPackage.POTENTIAL_TRANSFORMER__PT_CLASS:
				setPtClass((EA_Model.IEC61970.Domain.String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case MeasPackage.POTENTIAL_TRANSFORMER__ACCURACY_CLASS:
				setAccuracyClass((EA_Model.IEC61970.Domain.String)null);
				return;
			case MeasPackage.POTENTIAL_TRANSFORMER__NOMINAL_RATIO:
				setNominalRatio((EA_Model.IEC61970.Domain.Float)null);
				return;
			case MeasPackage.POTENTIAL_TRANSFORMER__PT_CLASS:
				setPtClass((EA_Model.IEC61970.Domain.String)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case MeasPackage.POTENTIAL_TRANSFORMER__ACCURACY_CLASS:
				return accuracyClass != null;
			case MeasPackage.POTENTIAL_TRANSFORMER__NOMINAL_RATIO:
				return nominalRatio != null;
			case MeasPackage.POTENTIAL_TRANSFORMER__PT_CLASS:
				return ptClass != null;
		}
		return super.eIsSet(featureID);
	}

} //PotentialTransformerImpl
